Best Splitter:

In constructing a BSP tree it is important to select the best splitter. How 
do we decide whether a splitter is good or bad? Eventually every polygon that
is passed to the BSP compiler will become a splitter. The task is to pick 
splitters in an order that will yield the least number of split polygons while
still maintaining a somewhat balanced tree. 

It is obvious that we don't want to pick a splitter that creates a lot of splits
because we want to keep our polygon count as low as possible. 

The reason that we want to keep our tree balanced is that an unbalanced tree 
tends to create a skippy frame rate because during the traversal of the tree going 
down say the front list might take twice as long as going down the back list. This 
would create a situation where (if the tree is badly unbalanced) the frame rate would 
drop if I was behind a wall which had a long string of nodes behind it and speed up 
if I move in front of it. 

This formula yields a good balance and allows us to select a reasonable splitter

score = absolute(frontfaces - backfaces) + (splits * 3)

The higher frontfaces - backfaces the worse this polygon is in terms of balance
then we add number of splits the polygon will generate. 3 merely says how much more
important I consider splits than balance.

Now while we build the BSP tree we loop through the poly list and perform the following
test (of course this means that every time we choose a splitter we must clasify this
polygon against all others in the list to get the frontfaces backfaces and splits values)
We take the polygon that yielded the smallest score at each stage as the current splitter.

Courtesy Gary Simmons 